package com.kgc.xs.pojo;


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.kgc.basic.annotation.DetailEntity;
import com.kgc.basic.annotation.PdfFieldMapping;
import com.kgc.basic.annotation.PdfTemplateConfig;
import com.kgc.basic.annotation.Validation;
//import lombok.AllArgsConstructor;
//import lombok.Data;
//import lombok.NoArgsConstructor;
//import lombok.ToString;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

//@Data
//@AllArgsConstructor
//@NoArgsConstructor
//@ToString
@PdfTemplateConfig(templatePath = "D:\\QQfiles\\测试导入导出\\销项发票打印模板_新.pdf")
public class SalesInvoice implements Serializable {

    @ExcelIgnore
    private Integer id;

    @ExcelProperty("销售发票单据编号")
    @Validation(required = true, message = "销售发票单据编号不能为空")
    @PdfFieldMapping(templateField = "code")
    private String code;

    @ExcelIgnore
    @PdfFieldMapping(templateField = "codeDate", format = "yyyy/MM/dd HH:mm:ss")
    private Date codeDate;

    @ExcelProperty("发票类型id")
    private Integer invoiceType;

    @ExcelProperty("发票类型")
    @Validation(required = true, message = "发票类型不能为空")
    private String invoice_type;

    @ExcelProperty("客户id")
    private Integer customerId;

    @ExcelProperty("客户名称")
    @Validation(required = true, message = "客户名称不能为空")
    @PdfFieldMapping(templateField = "customer")
    private String customer;

    @ExcelProperty("发票号")
    @Validation(required = true, message = "发票号不能为空")
    private String invoiceNum;

    @ExcelProperty("发票状态id")
    @Validation(required = true, regex = "^[0123]+$", message = "0.已作废 1.未审核 2.未执行 3.已执行")
    private Integer codeState;

    @ExcelProperty("发票状态")
    private String code_state;

    @ExcelProperty("源单号")
    @Validation(required = true, message = "源单号不能为空")
    private String originalOrderNum;

    @ExcelProperty("金额")
    @Validation(required = true, regex = "^[0-9]+\\\\.?[0-9]*$", message = "金额只能为数字")
    private BigDecimal amount;

    @ExcelIgnore
    @DetailEntity(detailClass = SalesInvoiceDetail.class, relationField = "invoiceCode")
    private List<SalesInvoiceDetail> details;

    @ExcelIgnore
    private Date orderCreationTime;

    @ExcelIgnore
    @PdfFieldMapping(templateField = "orderCreator")
    private String orderCreator;

    @ExcelIgnore
    private String orderDepartment;

    @ExcelIgnore
    private Date modifyTime;

    @ExcelIgnore
    private String modifier;

    @ExcelIgnore
    private Integer isDelete;

//    @ExcelIgnore
//    private String name;


    public String getCode_state() {
        return code_state;
    }

    public void setCode_state(String code_state) {
        this.code_state = code_state;
    }

    public String getInvoice_type() {
        return invoice_type;
    }

    public void setInvoice_type(String invoice_type) {
        this.invoice_type = invoice_type;
    }

    public String getCustomer() {
        return customer;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Date getCodeDate() {
        return codeDate;
    }

    public void setCodeDate(Date codeDate) {
        this.codeDate = codeDate;
    }

    public Integer getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceType(Integer invoiceType) {
        this.invoiceType = invoiceType;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public String getInvoiceNum() {
        return invoiceNum;
    }

    public void setInvoiceNum(String invoiceNum) {
        this.invoiceNum = invoiceNum;
    }

    public Integer getCodeState() {
        return codeState;
    }

    public void setCodeState(Integer codeState) {
        this.codeState = codeState;
    }

    public String getOriginalOrderNum() {
        return originalOrderNum;
    }

    public void setOriginalOrderNum(String originalOrderNum) {
        this.originalOrderNum = originalOrderNum;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public Date getOrderCreationTime() {
        return orderCreationTime;
    }

    public void setOrderCreationTime(Date orderCreationTime) {
        this.orderCreationTime = orderCreationTime;
    }

    public String getOrderCreator() {
        return orderCreator;
    }

    public void setOrderCreator(String orderCreator) {
        this.orderCreator = orderCreator;
    }

    public String getOrderDepartment() {
        return orderDepartment;
    }

    public void setOrderDepartment(String orderDepartment) {
        this.orderDepartment = orderDepartment;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifier() {
        return modifier;
    }

    public void setModifier(String modifier) {
        this.modifier = modifier;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public List<SalesInvoiceDetail> getDetails() {
        return details;
    }

    public void setDetails(List<SalesInvoiceDetail> details) {
        this.details = details;
    }

    @Override
    public String toString() {
        return "SalesInvoice{" +
                "id=" + id +
                ", code='" + code + '\'' +
                ", codeDate=" + codeDate +
                ", invoiceType=" + invoiceType +
                ", invoice_type='" + invoice_type + '\'' +
                ", customerId=" + customerId +
                ", customer='" + customer + '\'' +
                ", invoiceNum='" + invoiceNum + '\'' +
                ", codeState=" + codeState +
                ", code_state='" + code_state + '\'' +
                ", originalOrderNum='" + originalOrderNum + '\'' +
                ", amount=" + amount +
                ", details=" + details +
                ", orderCreationTime=" + orderCreationTime +
                ", orderCreator='" + orderCreator + '\'' +
                ", orderDepartment='" + orderDepartment + '\'' +
                ", modifyTime=" + modifyTime +
                ", modifier='" + modifier + '\'' +
                ", isDelete=" + isDelete +
                '}';
    }
}
